import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
//let base = '/testplatform/product'
let base = '/testplatform/productPublicPart'

export const queryProductPublicPart = params => {
  return axios({
    url: `${base}/page`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}
export const addProductPublicPart = data => {
  return axios({
    url: `${base}/add`,
    method: 'POST',
    headers: jsonHeaders,
    data
  })
}
export const updateProductPublicPart = data => {
  return axios({
    url: `${base}/update`,
    method: 'PUT',
    headers: jsonHeaders,
    data
  })
}
export const deleteProductPublicPart = id => {
  return axios({
    url: `${base}/deleteById/${id}`,
    method: 'DELETE',
    headers: jsonHeaders,
  })
}
export const addRelativeProduct = (id,partIds)=>{
  return axios({
    url:`${base}/addProductPublicPartRelation/${id}`,
    data:partIds,
    method:'POST',
    headers:jsonHeaders
  })
}
export const queryRelativeProduct = id=>{
  return axios({
    url:`${base}/queryProductPublicPartRelation/${id}`,
    method:'POST',
    headers:jsonHeaders
  })
}
export const queryInstallPosition = id=>{
  return axios({
    url:`${base}/queryInstallPosition/${id}`,
    method:'POST',
    headers:jsonHeaders
  })
}
